package gonz.common.config;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;

public class Settings {

    private static final String FILE_NAME = "settings.properties";
    private Configuration configuration;

    Settings() {
        try {
            configuration = new PropertiesConfiguration(FILE_NAME);
        } catch (ConfigurationException e) {
            throw new RuntimeException("Can't create configuration for " + FILE_NAME, e);

        }
    }

    public long getImplicitlyWait() {
        return configuration.getLong(SettingsKey.IMPLICITLY_WAIT.toString().toLowerCase());
    }

    public String getImplicitlyWaitUnit() {
        return configuration.getString(SettingsKey.IMPLICITLY_WAIT_UNIT.toString().toLowerCase());
    }

    public String getOutputFolderName() {
        return configuration.getString(SettingsKey.OUTPUT_FOLDER.toString().toLowerCase());

    }

}
